package com.ordertracker.persistent.dictionary;

import com.ordertracker.persistent.dictionary.template.AbstractClientTemplate;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Description of class.
 * Created 12/13/12 3:53 PM
 *
 * @author andrey.rodin@playtech.com
 */

@Entity
public class Client extends AbstractClientTemplate {

    private static final long serialVersionUID = -1499850518277016340L;

    @OneToOne(optional = true)
    @JoinColumns({
            @JoinColumn(name = "organization", referencedColumnName = "id")
    })
    private Organization organization;

    public Client() {
    }

    public Client(String name, Organization organization) {
        super.setName(name);
        this.organization = organization;
    }

    public Organization getOrganization() {
        return organization;
    }

    @Override
    public Class<?> getType() {
        return getClass();
    }

    public void setOrganization(Organization organization) {
        this.organization = organization;
    }
}
